package com.swgranada.pistachio;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;

public class UploaderActivity extends Activity {

	private String filename;
	private String path;
	private ProgressBar progress;
	private TextView result;
	private Button botonResubir;
	private Activity activity=this;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.uploader);
		progress = (ProgressBar) findViewById(R.id.progressBarUpload);
//		progress.setMax(100);
//		progress.setProgress(0);
		progress.setIndeterminate(true);
		result = (TextView) findViewById(R.id.uploadResult);
		botonResubir = (Button) findViewById(R.id.buttonResubir);
		
		filename = getIntent().getStringExtra("filename");
		path = getIntent().getStringExtra("path");
		
		new VideoUploader(this, progress, result, botonResubir).execute(filename, path);

		
		botonResubir.setOnClickListener(new OnClickListener() {
			
			public void onClick(View arg0) {
				// abrir la activity SUCCESS
				Intent i = new Intent(activity, GrabaVideo.class);
				activity.startActivity(i);	
			}
		});
		
		
		
	}

	
	
	
}
